package edu.kjxy.worker0312;

import java.util.Scanner;

public class worker07 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long num = in.nextLong();
		long sum = 0;
		while(true) {
			sum += num % 10;
			num /= 10;
			if(num == 0) break;
		}
		System.out.println(sum);
		in.close();
	}

}
